<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: DoubleLinkedList.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">DoubleLinkedList.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="DoubleLinkedList_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#ifndef DOUBLELINKEDLIST_H_</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#define DOUBLELINKEDLIST_H_</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include&lt;iostream&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include&lt;cstdlib&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">using namespace </span>std;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> DT&gt;</div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html">   25</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;{</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <span class="keyword">private</span>:</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        <span class="keyword">struct </span>Node</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        {</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;            DT data;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;            Node *prev;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;            Node *next;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            Node(<span class="keyword">const</span> DT&amp; d=DT{},Node* p=<span class="keyword">nullptr</span>,Node* n=<span class="keyword">nullptr</span>)</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;            :data{d},prev{p},next{n}{}</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;            Node(DT &amp;&amp;d,Node* p=<span class="keyword">nullptr</span>,Node* n=<span class="keyword">nullptr</span>)</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;            :data{std::move(d)},prev{p},next{n}{}</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        };</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html">   66</a></span>&#160;        <span class="keyword">class </span><a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        {</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a112ee57553bfe22c9a26c21267bfd226">   74</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a112ee57553bfe22c9a26c21267bfd226">const_iterator</a>() : current(nullptr){}</div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a3402baf1083aa613ca04732e7d783179">   81</a></span>&#160;            <span class="keyword">const</span> DT&amp; <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a3402baf1083aa613ca04732e7d783179">operator*</a>()<span class="keyword">const</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="keyword">            </span>{</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;                <span class="keywordflow">return</span> retrieve();</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;            }</div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a4f6c7762f7932f1abcd6286b9c8360e1">   91</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a>&amp; <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a4f6c7762f7932f1abcd6286b9c8360e1">operator++</a>()</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;            {</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;                current=current-&gt;next;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            }</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#ac942285901621d71c0ea312ee2e16149">  103</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> &amp; <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#ac942285901621d71c0ea312ee2e16149">operator++</a>(<span class="keywordtype">int</span>)</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;            {</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;                <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> old=*<span class="keyword">this</span>;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                ++(*this);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                <span class="keywordflow">return</span> old;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            }</div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#ad93b067ec784301698d9890c721d3668">  114</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> &amp; <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#ad93b067ec784301698d9890c721d3668">operator--</a>()</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;            {</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;                current=current-&gt;prev;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;            }</div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#acfca335a1870bcccdb3f656b95ed1fad">  125</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#acfca335a1870bcccdb3f656b95ed1fad">operator--</a>(<span class="keywordtype">int</span>)</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            {</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;                <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> old=*<span class="keyword">this</span>;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;                --(*this);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                <span class="keywordflow">return</span> old;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160; </div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;            }</div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a512b2d20b89afad27ab692e8ea1134d4">  141</a></span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a512b2d20b89afad27ab692e8ea1134d4">operator==</a>(<span class="keyword">const</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> &amp; rhs)<span class="keyword">const</span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="keyword">            </span>{</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;                <span class="keywordflow">return</span> current==rhs.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            }</div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a2446ddd53bbc08c8b2fcc333db23ccb4">  152</a></span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a2446ddd53bbc08c8b2fcc333db23ccb4">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> &amp; rhs)<span class="keyword">const</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="keyword">            </span>{</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;                <span class="keywordflow">return</span> !(*<span class="keyword">this</span>==rhs);</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;            }</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160; </div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">  163</a></span>&#160;            Node *<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>;   </div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#ae1db2e1e4c42600c184f6162157e4635">  170</a></span>&#160;            DT&amp; <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#ae1db2e1e4c42600c184f6162157e4635">retrieve</a>()<span class="keyword">const</span></div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="keyword">            </span>{</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;                <span class="keywordflow">return</span> current-&gt;data;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;            }</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1const__iterator.html#a32e0bd5fcc6b2379ab6ffceb154a3058">  180</a></span>&#160;            <a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a32e0bd5fcc6b2379ab6ffceb154a3058">const_iterator</a>(Node* p): current{p}{}</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;            <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a>&lt;DT&gt;;</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        };</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160; </div>
<div class="line"><a name="l00195"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html">  195</a></span>&#160;        <span class="keyword">class </span><a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a>:<span class="keyword">public</span> <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a></div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        {</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;            <span class="keyword">public</span>:</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;                <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a>(){}</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;                DT&amp; operator*()</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;                {</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;                    <span class="keywordflow">return</span> const_iterator::retrieve();</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;                }</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;                <span class="keyword">const</span> DT&amp; operator*()<span class="keyword">const</span></div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;<span class="keyword">                </span>{</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;                    <span class="keywordflow">return</span> const_iterator:: operator*();</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;                }</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;                <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a>&amp; operator++()</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;                {</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;                    this-&gt;current=this-&gt;current-&gt;next;</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;                    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;                }</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160; </div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;                <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a>  operator++(<span class="keywordtype">int</span>)        </div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;                {</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;                    <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> old = *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;                    ++(*this);</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;                    <span class="keywordflow">return</span> old;</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;                }</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160; </div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;                <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> operator--()</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;                {</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;                    this-&gt;current=this-&gt;current-&gt;prev;</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;                    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;                }</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160; </div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;                <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> operator--(<span class="keywordtype">int</span>)</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;                {</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;                    <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> old = *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;                    --(*this);</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;                    <span class="keywordflow">return</span> old; </div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;                }</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;            </div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;            <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="classDoubleLinkedList_1_1iterator.html#ada0b7927d510a3dcb98ca16f27c485f2">  242</a></span>&#160;                <a class="code" href="classDoubleLinkedList_1_1iterator.html#ada0b7927d510a3dcb98ca16f27c485f2">iterator</a>(Node* p):<a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a>{p}{};</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;                <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a>&lt;DT&gt;;</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;        };</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160; </div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#aee88179cbec704a72abc4ffedaaae206">  252</a></span>&#160;        <a class="code" href="classDoubleLinkedList.html#aee88179cbec704a72abc4ffedaaae206">DoubleLinkedList</a>(){init();}</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160; </div>
<div class="line"><a name="l00258"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a941489c5c72cb46a00e24ff1c998b087">  258</a></span>&#160;        <a class="code" href="classDoubleLinkedList.html#a941489c5c72cb46a00e24ff1c998b087">~DoubleLinkedList</a>()</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;            <a class="code" href="classDoubleLinkedList.html#ae137341cb837578aceed300d50ebe664">clear</a>();</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;            <span class="keyword">delete</span> head;</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;            <span class="keyword">delete</span> tail;</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        }</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160; </div>
<div class="line"><a name="l00272"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a9f6fd6fab778f30041aa6119b67d70db">  272</a></span>&#160;        <a class="code" href="classDoubleLinkedList.html#a9f6fd6fab778f30041aa6119b67d70db">DoubleLinkedList</a>(<span class="keyword">const</span> <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a>&amp; rhs)</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        {</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;            init();</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;            <span class="keywordflow">for</span>(<span class="keyword">auto</span> &amp; x:rhs)</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;                <a class="code" href="classDoubleLinkedList.html#a28c753ec25efce9713e58170bfa9812c">push_back</a>(x);</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;        }</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160; </div>
<div class="line"><a name="l00286"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a857b3efd79c7794a99b82bbe65d4f2a9">  286</a></span>&#160;        <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a>&amp; <a class="code" href="classDoubleLinkedList.html#a857b3efd79c7794a99b82bbe65d4f2a9">operator=</a>(<span class="keyword">const</span> <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a>&amp; rhs)</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;        {</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;            <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> copy=rhs;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;            std::swap(*<span class="keyword">this</span>, copy);</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;        }</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160; </div>
<div class="line"><a name="l00299"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a1a2a7c993e056a3d7e15bd1bf3d38bf2">  299</a></span>&#160;        <a class="code" href="classDoubleLinkedList.html#a1a2a7c993e056a3d7e15bd1bf3d38bf2">DoubleLinkedList</a>(<a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> &amp;&amp; rhs)</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        :theSize{rhs.theSize},head{rhs.head},tail{rhs.tail}</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        {</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;            rhs.theSize=0;</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;            rhs.head=<span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;            rhs.tail=<span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;        }</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160; </div>
<div class="line"><a name="l00314"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a134e16aa90f251ec1fe732b8b83a758d">  314</a></span>&#160;        <a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a>&amp; <a class="code" href="classDoubleLinkedList.html#a134e16aa90f251ec1fe732b8b83a758d">operator=</a>(<a class="code" href="classDoubleLinkedList.html">DoubleLinkedList</a> &amp;&amp; rhs)</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;        {</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;            std::swap(theSize,rhs.theSize);</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;            std::swap(head,rhs.head);</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;            std::swap(tail,rhs.tail);</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        }</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160; </div>
<div class="line"><a name="l00327"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">  327</a></span>&#160;        <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>()</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;        {<span class="keywordflow">return</span> {head-&gt;next};}</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;        </div>
<div class="line"><a name="l00335"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#abb15c59c5b15dbdecae44e186e7c9b2d">  335</a></span>&#160;        <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classDoubleLinkedList.html#abb15c59c5b15dbdecae44e186e7c9b2d">begin</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> {head-&gt;next};}</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160; </div>
<div class="line"><a name="l00343"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">  343</a></span>&#160;        <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>()</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;        {<span class="keywordflow">return</span> {tail};}</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160; </div>
<div class="line"><a name="l00351"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a683ec24475d58d896c47b00d9893fb6d">  351</a></span>&#160;        <a class="code" href="classDoubleLinkedList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classDoubleLinkedList.html#a683ec24475d58d896c47b00d9893fb6d">end</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> {tail};}</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;        </div>
<div class="line"><a name="l00359"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a896b91eefaa6a0288e31a846382d1d39">  359</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="classDoubleLinkedList.html#a896b91eefaa6a0288e31a846382d1d39">size</a>()<span class="keyword">const</span></div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> theSize;}</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160; </div>
<div class="line"><a name="l00368"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a8ebe0a7e9218900f723620eb5359df6c">  368</a></span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classDoubleLinkedList.html#a8ebe0a7e9218900f723620eb5359df6c">empty</a>()<span class="keyword">const</span></div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> <a class="code" href="classDoubleLinkedList.html#a896b91eefaa6a0288e31a846382d1d39">size</a>()==0;}</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160; </div>
<div class="line"><a name="l00375"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#ae137341cb837578aceed300d50ebe664">  375</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#ae137341cb837578aceed300d50ebe664">clear</a>()</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;        {</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;            <span class="keywordflow">while</span>(!<a class="code" href="classDoubleLinkedList.html#a8ebe0a7e9218900f723620eb5359df6c">empty</a>())</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;                pop_front();</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;        }</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160; </div>
<div class="line"><a name="l00387"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a321d39c83c64c5a56491cfb6312c3112">  387</a></span>&#160;        DT&amp; <a class="code" href="classDoubleLinkedList.html#a321d39c83c64c5a56491cfb6312c3112">front</a>()</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;        {<span class="keywordflow">return</span> *<a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>();}</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160; </div>
<div class="line"><a name="l00395"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a783cd5151e28aa5396fa7ea79f64835b">  395</a></span>&#160;        <span class="keyword">const</span> DT&amp; <a class="code" href="classDoubleLinkedList.html#a783cd5151e28aa5396fa7ea79f64835b">front</a>()<span class="keyword">const</span></div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> *<a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>();}</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160; </div>
<div class="line"><a name="l00403"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#ae4df7660c6cb44e3176de9e748a8f755">  403</a></span>&#160;        <span class="keyword">const</span> DT&amp; <a class="code" href="classDoubleLinkedList.html#ae4df7660c6cb44e3176de9e748a8f755">back</a>()<span class="keyword">const</span></div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;<span class="keyword">        </span>{<span class="keywordflow">return</span> *--<a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>();}</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160; </div>
<div class="line"><a name="l00412"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#abc9f1f67bf23ed7ffc31361eaa14d0f6">  412</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#abc9f1f67bf23ed7ffc31361eaa14d0f6">push_front</a>(<span class="keyword">const</span> DT&amp; x) </div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;        {<a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>(<a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>(),x);}</div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160; </div>
<div class="line"><a name="l00420"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a9d82e154514bdc6379c83df36c86a63b">  420</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#a9d82e154514bdc6379c83df36c86a63b">push_front</a>(DT &amp;&amp; x)</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;        {<a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>(<a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>(),std::move(x));}</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160; </div>
<div class="line"><a name="l00428"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a28c753ec25efce9713e58170bfa9812c">  428</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#a28c753ec25efce9713e58170bfa9812c">push_back</a>(<span class="keyword">const</span> DT&amp; x)</div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;        {<a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>(<a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>(),x);}</div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160; </div>
<div class="line"><a name="l00436"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#ad87b5006784034695d430e894eb989b4">  436</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#ad87b5006784034695d430e894eb989b4">push_back</a>(<span class="keyword">const</span> DT &amp;&amp; x)</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;        {<a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>(<a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>(),std::move(x));}</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160; </div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;        <span class="keywordtype">void</span> pop_front()</div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;        {<a class="code" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">erase</a>(<a class="code" href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">begin</a>());}                  </div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160; </div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;        <span class="keywordtype">void</span> pop_back()</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;        {<a class="code" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">erase</a>(--<a class="code" href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">end</a>());}</div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160; </div>
<div class="line"><a name="l00452"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">  452</a></span>&#160;        <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">insert</a>(<a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> itr,<span class="keyword">const</span> DT&amp; x)</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;        {</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;            Node *p=itr.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>;</div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;            theSize++;</div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;            <span class="keywordflow">return</span> {p-&gt;prev=p-&gt;prev-&gt;next=<span class="keyword">new</span> Node{x,p-&gt;prev,p}};</div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;        }</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160; </div>
<div class="line"><a name="l00466"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a3020daa2982b73be237e0b7735342d4c">  466</a></span>&#160;        <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#a3020daa2982b73be237e0b7735342d4c">insert</a>(<a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> itr,DT &amp;&amp; x)</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;        {</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;            Node *p = itr.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>;</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;            theSize++;</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;            <span class="keywordflow">return</span>{p-&gt;prev=p-&gt;prev-&gt;next=<span class="keyword">new</span> Node{x,p-&gt;prev,p}};</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;        }</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160; </div>
<div class="line"><a name="l00479"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">  479</a></span>&#160;        <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">erase</a>(<a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> itr)</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;        {</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;            Node *p=itr.<a class="code" href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">current</a>;</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;            <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> retVal{p-&gt;next};</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;            p-&gt;prev-&gt;next=p-&gt;next;</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;            p-&gt;next-&gt;prev=p-&gt;prev;</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;            <span class="keyword">delete</span> p;</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;            theSize--;</div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;            <span class="keywordflow">return</span> retVal;</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;        }</div>
<div class="line"><a name="l00496"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#acf8915685317c85b100b793123c14aba">  496</a></span>&#160;        <a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> <a class="code" href="classDoubleLinkedList.html#acf8915685317c85b100b793123c14aba">erase</a>(<a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> from,<a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> to)</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;        {</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;            <span class="keywordflow">for</span>(<a class="code" href="classDoubleLinkedList_1_1iterator.html">iterator</a> itr=from;itr!=to;)</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;                itr=<a class="code" href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">erase</a>(itr);</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;            <span class="keywordflow">return</span> to;</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;        }</div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160; </div>
<div class="line"><a name="l00507"></a><span class="lineno"><a class="line" href="classDoubleLinkedList.html#a500d8b83580e3a67ef1118e6bef7635c">  507</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classDoubleLinkedList.html#a500d8b83580e3a67ef1118e6bef7635c">printList</a>()</div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;        {</div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;            <span class="keywordflow">for</span>(Node *p=head-&gt;next;p!=tail;p=p-&gt;next)</div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;            {</div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;                cout &lt;&lt; p-&gt;data&lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;            }</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;            cout &lt;&lt; <span class="charliteral">&#39;\n&#39;</span>;</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;        }</div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;        iterator <a class="code" href="classDoubleLinkedList.html#aa9278da68a6f9195089a835ee71f5e27">find</a>(<a class="code" href="classDoubleLinkedList.html">DoubleLinkedList&lt;DT&gt;</a>&amp; _list,<span class="keyword">const</span> DT&amp; _val);</div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;    <span class="keyword">private</span>:</div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;        <span class="keywordtype">int</span> theSize;         </div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;        Node *head;          </div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;        Node *tail;          </div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160; </div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;        <span class="keywordtype">void</span> init()     </div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;        {</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;            theSize=0;</div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;            tail=<span class="keyword">new</span> Node;</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;            head=<span class="keyword">new</span> Node;</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;            head-&gt;next=tail;</div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;            tail-&gt;prev=head;</div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;        }</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160; </div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160; </div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160; </div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;        </div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160; </div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;};</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160; </div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160; </div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160; </div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html">DoubleLinkedList::const_iterator</a></div><div class="ttdoc">A brief discprition of const_iterator The const_iterator is unable to change member variables,...</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:67</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a112ee57553bfe22c9a26c21267bfd226"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a112ee57553bfe22c9a26c21267bfd226">DoubleLinkedList::const_iterator::const_iterator</a></div><div class="ttdeci">const_iterator()</div><div class="ttdoc">Construct a new const iterator object.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:74</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a2446ddd53bbc08c8b2fcc333db23ccb4"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a2446ddd53bbc08c8b2fcc333db23ccb4">DoubleLinkedList::const_iterator::operator!=</a></div><div class="ttdeci">bool operator!=(const const_iterator &amp;rhs) const</div><div class="ttdoc">akin to the overload ==</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:152</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a32e0bd5fcc6b2379ab6ffceb154a3058"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a32e0bd5fcc6b2379ab6ffceb154a3058">DoubleLinkedList::const_iterator::const_iterator</a></div><div class="ttdeci">const_iterator(Node *p)</div><div class="ttdoc">Construct a new const iterator object.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:180</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a3402baf1083aa613ca04732e7d783179"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a3402baf1083aa613ca04732e7d783179">DoubleLinkedList::const_iterator::operator*</a></div><div class="ttdeci">const DT &amp; operator*() const</div><div class="ttdoc">Redefine the operator *, using for read the data of the node.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:81</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a4f6c7762f7932f1abcd6286b9c8360e1"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a4f6c7762f7932f1abcd6286b9c8360e1">DoubleLinkedList::const_iterator::operator++</a></div><div class="ttdeci">const_iterator &amp; operator++()</div><div class="ttdoc">Redefine the operator ++(front type). current point to the next node.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:91</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a512b2d20b89afad27ab692e8ea1134d4"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a512b2d20b89afad27ab692e8ea1134d4">DoubleLinkedList::const_iterator::operator==</a></div><div class="ttdeci">bool operator==(const const_iterator &amp;rhs) const</div><div class="ttdoc">Redefine == Judje whether two iterators are identical.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:141</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_a746a66ff1facbbf98a43e86cd6d11724"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#a746a66ff1facbbf98a43e86cd6d11724">DoubleLinkedList::const_iterator::current</a></div><div class="ttdeci">Node * current</div><div class="ttdoc">Copy the pointer of node in existence It's procted thus it could be visited by the inheritance of the...</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:163</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_ac942285901621d71c0ea312ee2e16149"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#ac942285901621d71c0ea312ee2e16149">DoubleLinkedList::const_iterator::operator++</a></div><div class="ttdeci">const_iterator &amp; operator++(int)</div><div class="ttdoc">Redefine the operator ++(back type) Due to old is temporary, usage of reference is wrong.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:103</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_acfca335a1870bcccdb3f656b95ed1fad"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#acfca335a1870bcccdb3f656b95ed1fad">DoubleLinkedList::const_iterator::operator--</a></div><div class="ttdeci">const_iterator operator--(int)</div><div class="ttdoc">visit the previous node</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:125</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_ad93b067ec784301698d9890c721d3668"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#ad93b067ec784301698d9890c721d3668">DoubleLinkedList::const_iterator::operator--</a></div><div class="ttdeci">const_iterator &amp; operator--()</div><div class="ttdoc">visit the previous node</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:114</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1const__iterator_html_ae1db2e1e4c42600c184f6162157e4635"><div class="ttname"><a href="classDoubleLinkedList_1_1const__iterator.html#ae1db2e1e4c42600c184f6162157e4635">DoubleLinkedList::const_iterator::retrieve</a></div><div class="ttdeci">DT &amp; retrieve() const</div><div class="ttdoc">Return the reference of data pointed by current.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:170</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1iterator_html"><div class="ttname"><a href="classDoubleLinkedList_1_1iterator.html">DoubleLinkedList::iterator</a></div><div class="ttdoc">the public type inheritance of const_iterator It could only visit auto objects and all the member fun...</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:196</div></div>
<div class="ttc" id="aclassDoubleLinkedList_1_1iterator_html_ada0b7927d510a3dcb98ca16f27c485f2"><div class="ttname"><a href="classDoubleLinkedList_1_1iterator.html#ada0b7927d510a3dcb98ca16f27c485f2">DoubleLinkedList::iterator::iterator</a></div><div class="ttdeci">iterator(Node *p)</div><div class="ttdoc">Construct a new iterator object the constructor of its parent fuction is called.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:242</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html"><div class="ttname"><a href="classDoubleLinkedList.html">DoubleLinkedList</a></div><div class="ttdoc">define a class of a double linked class The class includes a structure named Node,...</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:26</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a134e16aa90f251ec1fe732b8b83a758d"><div class="ttname"><a href="classDoubleLinkedList.html#a134e16aa90f251ec1fe732b8b83a758d">DoubleLinkedList::operator=</a></div><div class="ttdeci">DoubleLinkedList &amp; operator=(DoubleLinkedList &amp;&amp;rhs)</div><div class="ttdoc">It's a move assignment It was used to avoid the process of copy.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:314</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a1a2a7c993e056a3d7e15bd1bf3d38bf2"><div class="ttname"><a href="classDoubleLinkedList.html#a1a2a7c993e056a3d7e15bd1bf3d38bf2">DoubleLinkedList::DoubleLinkedList</a></div><div class="ttdeci">DoubleLinkedList(DoubleLinkedList &amp;&amp;rhs)</div><div class="ttdoc">Construct a new Double Linked List object It's a move constructor, avoiding the copying process.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:299</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a28c753ec25efce9713e58170bfa9812c"><div class="ttname"><a href="classDoubleLinkedList.html#a28c753ec25efce9713e58170bfa9812c">DoubleLinkedList::push_back</a></div><div class="ttdeci">void push_back(const DT &amp;x)</div><div class="ttdoc">Similar to above.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:428</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a3020daa2982b73be237e0b7735342d4c"><div class="ttname"><a href="classDoubleLinkedList.html#a3020daa2982b73be237e0b7735342d4c">DoubleLinkedList::insert</a></div><div class="ttdeci">iterator insert(iterator itr, DT &amp;&amp;x)</div><div class="ttdoc">similar to above but avoid copy</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:466</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a321d39c83c64c5a56491cfb6312c3112"><div class="ttname"><a href="classDoubleLinkedList.html#a321d39c83c64c5a56491cfb6312c3112">DoubleLinkedList::front</a></div><div class="ttdeci">DT &amp; front()</div><div class="ttdoc">Return the data of the first node '*' was overloaded.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:387</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a500d8b83580e3a67ef1118e6bef7635c"><div class="ttname"><a href="classDoubleLinkedList.html#a500d8b83580e3a67ef1118e6bef7635c">DoubleLinkedList::printList</a></div><div class="ttdeci">void printList()</div><div class="ttdoc">print the all the data in the container</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:507</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a63980ca7417c2816904717c1cc4802cd"><div class="ttname"><a href="classDoubleLinkedList.html#a63980ca7417c2816904717c1cc4802cd">DoubleLinkedList::erase</a></div><div class="ttdeci">iterator erase(iterator itr)</div><div class="ttdoc">Delete the node pointed by itr Return the next pointer after itr.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:479</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a683ec24475d58d896c47b00d9893fb6d"><div class="ttname"><a href="classDoubleLinkedList.html#a683ec24475d58d896c47b00d9893fb6d">DoubleLinkedList::end</a></div><div class="ttdeci">const_iterator end() const</div><div class="ttdoc">return tail, able to visit constant object</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:351</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a76384816354f94d8d42e0829c7bda914"><div class="ttname"><a href="classDoubleLinkedList.html#a76384816354f94d8d42e0829c7bda914">DoubleLinkedList::begin</a></div><div class="ttdeci">iterator begin()</div><div class="ttdoc">return the first node</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:327</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a781eabd9902464b05665ba9a5d547035"><div class="ttname"><a href="classDoubleLinkedList.html#a781eabd9902464b05665ba9a5d547035">DoubleLinkedList::insert</a></div><div class="ttdeci">iterator insert(iterator itr, const DT &amp;x)</div><div class="ttdoc">Construct a node and insert before the itr pointer.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:452</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a783cd5151e28aa5396fa7ea79f64835b"><div class="ttname"><a href="classDoubleLinkedList.html#a783cd5151e28aa5396fa7ea79f64835b">DoubleLinkedList::front</a></div><div class="ttdeci">const DT &amp; front() const</div><div class="ttdoc">const type</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:395</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a857b3efd79c7794a99b82bbe65d4f2a9"><div class="ttname"><a href="classDoubleLinkedList.html#a857b3efd79c7794a99b82bbe65d4f2a9">DoubleLinkedList::operator=</a></div><div class="ttdeci">DoubleLinkedList &amp; operator=(const DoubleLinkedList &amp;rhs)</div><div class="ttdoc">assignment operation It is called when an lvalue is transmitted</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:286</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a896b91eefaa6a0288e31a846382d1d39"><div class="ttname"><a href="classDoubleLinkedList.html#a896b91eefaa6a0288e31a846382d1d39">DoubleLinkedList::size</a></div><div class="ttdeci">int size() const</div><div class="ttdoc">return the number of Node structures</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:359</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a8ebe0a7e9218900f723620eb5359df6c"><div class="ttname"><a href="classDoubleLinkedList.html#a8ebe0a7e9218900f723620eb5359df6c">DoubleLinkedList::empty</a></div><div class="ttdeci">bool empty() const</div><div class="ttdoc">judje if the class dosen't have any node</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:368</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a941489c5c72cb46a00e24ff1c998b087"><div class="ttname"><a href="classDoubleLinkedList.html#a941489c5c72cb46a00e24ff1c998b087">DoubleLinkedList::~DoubleLinkedList</a></div><div class="ttdeci">~DoubleLinkedList()</div><div class="ttdoc">Destroy the Double Linked List object.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:258</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a9d82e154514bdc6379c83df36c86a63b"><div class="ttname"><a href="classDoubleLinkedList.html#a9d82e154514bdc6379c83df36c86a63b">DoubleLinkedList::push_front</a></div><div class="ttdeci">void push_front(DT &amp;&amp;x)</div><div class="ttdoc">akin to above but called when an rvalue was transmitted</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:420</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_a9f6fd6fab778f30041aa6119b67d70db"><div class="ttname"><a href="classDoubleLinkedList.html#a9f6fd6fab778f30041aa6119b67d70db">DoubleLinkedList::DoubleLinkedList</a></div><div class="ttdeci">DoubleLinkedList(const DoubleLinkedList &amp;rhs)</div><div class="ttdoc">Construct a new Double Linked List object Copy constructor. Local variable x was used for traversing ...</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:272</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_aa52f0a0dea8b178abf3972cb5c7ba44b"><div class="ttname"><a href="classDoubleLinkedList.html#aa52f0a0dea8b178abf3972cb5c7ba44b">DoubleLinkedList::end</a></div><div class="ttdeci">iterator end()</div><div class="ttdoc">return tail</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:343</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_aa9278da68a6f9195089a835ee71f5e27"><div class="ttname"><a href="classDoubleLinkedList.html#aa9278da68a6f9195089a835ee71f5e27">DoubleLinkedList::find</a></div><div class="ttdeci">iterator find(DoubleLinkedList&lt; DT &gt; &amp;_list, const DT &amp;_val)</div><div class="ttdoc">find a specific data in the list Return the finded iterator when successful Return nullptr and output...</div><div class="ttdef"><b>Definition:</b> main.cpp:26</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_abb15c59c5b15dbdecae44e186e7c9b2d"><div class="ttname"><a href="classDoubleLinkedList.html#abb15c59c5b15dbdecae44e186e7c9b2d">DoubleLinkedList::begin</a></div><div class="ttdeci">const_iterator begin() const</div><div class="ttdoc">return the first node, called by a constant object</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:335</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_abc9f1f67bf23ed7ffc31361eaa14d0f6"><div class="ttname"><a href="classDoubleLinkedList.html#abc9f1f67bf23ed7ffc31361eaa14d0f6">DoubleLinkedList::push_front</a></div><div class="ttdeci">void push_front(const DT &amp;x)</div><div class="ttdoc">Insert the element as first node Called when lvalue was transmitted.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:412</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_acf8915685317c85b100b793123c14aba"><div class="ttname"><a href="classDoubleLinkedList.html#acf8915685317c85b100b793123c14aba">DoubleLinkedList::erase</a></div><div class="ttdeci">iterator erase(iterator from, iterator to)</div><div class="ttdoc">earase from pointer from until to and return to</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:496</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_ad87b5006784034695d430e894eb989b4"><div class="ttname"><a href="classDoubleLinkedList.html#ad87b5006784034695d430e894eb989b4">DoubleLinkedList::push_back</a></div><div class="ttdeci">void push_back(const DT &amp;&amp;x)</div><div class="ttdoc">Similar to above.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:436</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_ae137341cb837578aceed300d50ebe664"><div class="ttname"><a href="classDoubleLinkedList.html#ae137341cb837578aceed300d50ebe664">DoubleLinkedList::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">delete all nodes</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:375</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_ae4df7660c6cb44e3176de9e748a8f755"><div class="ttname"><a href="classDoubleLinkedList.html#ae4df7660c6cb44e3176de9e748a8f755">DoubleLinkedList::back</a></div><div class="ttdeci">const DT &amp; back() const</div><div class="ttdoc">return the data of the last node</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:403</div></div>
<div class="ttc" id="aclassDoubleLinkedList_html_aee88179cbec704a72abc4ffedaaae206"><div class="ttname"><a href="classDoubleLinkedList.html#aee88179cbec704a72abc4ffedaaae206">DoubleLinkedList::DoubleLinkedList</a></div><div class="ttdeci">DoubleLinkedList()</div><div class="ttdoc">Construct a new Double Linked List object.</div><div class="ttdef"><b>Definition:</b> DoubleLinkedList.h:252</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
